package com.servlet.www.webroot;

import javax.servlet.*;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @author 新技术软件：汪洋
 */
public class PrimitiveServlet implements Servlet {
    /**
     * init方法只在servlet初始化时调用一次，例如加载数据库驱动，值得初始化等
     */
    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
        System.out.println("init");
    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        System.out.println("form Service");
        PrintWriter out = servletResponse.getWriter();
        out.println("hello , rose there");
        out.print("hello , blue pussy");
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {
        System.out.println("destroy");
    }
}
